import React from 'react';
import './index.less';
import PropTypes from 'prop-types';
import CommonHeader from 'COMPONENT/CommonHeader';
import { Button } from 'antd-mobile';


class HmdMain extends React.Component { 
    static contextTypes = {
        router: PropTypes.object.isRequired
    }
    constructor(props){ 
        super(props);

        this.state={ 
            hmdData:{
               month:'2015-12-11',
               money:'123,000.00',
               code:'321412341234',
               dueDate:'每月1号',
               endDate:'2022-10-10',
               type:'商贷',
            },
        }
    }

    componentDidMount(){ 
        //初始化
    }
    //跳转还款计划
    loanPlan=()=>{ 
        this.context.router.push({
			pathname: '/HmdMain/RepaymentSchedule'
        })
    }
    //跳转提前还款
    Repayment=()=>{ 
        console.log("fff");
        this.context.router.push({
			pathname: '/MineLoan/MineLoanPrepayment'
        })
    }
    //跳转贷款信息变更
    changeInfo=()=>{ 
        
        // this.context.router.push({
		// 	pathname: '/houseLoanAdd'
        // })
    }
    //跳转借款凭证
    loanCertificate=()=>{ 
            
           this.context.router.push({
           	pathname: '/HmdMain/LoanVoucher'
           })
    }
    //跳转借款凭证
    eleContract=()=>{ 
            
        // this.context.router.push({
        // 	pathname: '/houseLoanAdd'
        // })
    }
    //返回
    btnClick=()=>{ 
        
        // this.context.router.push({
		// 	pathname: '/HmdMain/HmdCTools'
        // })
    }

    render() {
        
        return (
            <div className="loan_infromation">
           		<CommonHeader 
					name='贷款信息详情'					
					leftContentTitle="@back" 
					leftContent='返回'
				/>
				<div style={{height:'.9rem'}}></div>

                <div className="hmd_apply_middle">
                    <div className="hmd_apply_middle_info">
                        <div className="hmd_apply_middle_info_down">
                            <div> 
                                <span>贷款种类</span>
                                <span>{this.state.hmdData.type}</span>
                            </div>
                            <div> 
                                <span>贷款编号</span>
                                <span>{this.state.hmdData.code}</span>
                            </div>
                            <div> 
                                <span>贷款金额</span>
                                <span>{this.state.hmdData.money}</span>
                            </div>
                            <div> 
                                <span>贷款提取日期</span>
                                <span>{this.state.hmdData.endDate}</span>
                            </div>
                            <div> 
                                <span>还款日</span>
                                <span>{this.state.hmdData.dueDate}</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div className="hmd_title">
                    <span>贷款管理</span>
                </div>
                <div className="hmd_apply_middle">
                    <div className="hmd_apply_middle_info">
                        <div className="hmd_apply_middle_info_down">
                            <div> 
                                <span>还款信息查询</span>
                                <span className="span_last" onClick={this.loanPlan}>查看还款计划</span>
                            </div>
                            <div> 
                                <span>提前还款</span>
                                <span className="span_last" onClick={this.Repayment}>确认</span>
                            </div>
                            <div> 
                                <span className="width45">贷款信息变更查询</span>
                                <span className="span_last"  onClick={this.changeInfo} style={{
                                	color:'#ccc'
                                }}>查看</span>
                            </div>
                        </div>
                    </div>
                </div>

                <div className="hmd_title">
                    <span>业务变更</span>
                </div>
                <div className="hmd_apply_middle">
                    <div className="hmd_apply_middle_info">
                        <div className="hmd_apply_middle_info_down">
                            <div> 
                                <span>借款凭证</span>
                                <span className="span_last"  onClick={this.loanCertificate}>查看</span>
                            </div>
                            <div> 
                                <span>电子合同</span>
                                <span className="span_last"  onClick={this.eleContract} style={{
                                	color:'#ccc'
                                }}>查看</span>
                            </div>
                        </div>
                    </div>
                </div>


                <div className="hmd_apply_btn">
                    <Button type="primary" inline className="form_btn" onClick={this.btnClick}>返回</Button>
                </div>
            </div>
        );
    }
}
export default HmdMain;